#include <iostream>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>


void *run(void *args)
{
    while(true)
    {
        std::cout << " i am a new thread, getpid: " << getpid() << std::endl;
        sleep(3);
    }
}
int main()
{
    std::cout << " i am a project, getpid: " << getpid() << std::endl;

    pthread_t tid;
    pthread_create(&tid, nullptr, run, (void*)"thread_1");

    while(true)
    {
        std::cout << " i am main thread, getpid: " << getpid() << std::endl;
        sleep(3);
    }

    return 0;

}